import React from 'react';
export const SearchPanel = ({ fruits, list, param, setParam }) => {
  return (
    <form>
      <input
        type="text"
        value={param.name}
        onChange={(evt) => {
          // setParam(Object.assign({}, param, { name: evt.target.value }));
          setParam({ ...param, name: evt.target.value });
        }}
        placeholder="请输入关键字"
      />

      <select
        value={param.id}
        onChange={(evt) => {
          console.log(evt);
          setParam({ ...param, id: evt.target.value });
        }}
      >
        <option value={''}>请选择</option>
        {fruits.map((item) => {
          return (
            <option value={item.id} key={item.id}>
              {item.name}
            </option>
          );
        })}
      </select>
    </form>
  );
};
